<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui" 
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"> 

     <style type="text/css">
        
        .rotulos{
                font-family: verdana;
                font-size: 12px;
                font-weight: bold;
                color:#4F4F4F;
            }
    </style>
    
    <p:dialog id="UserDialog" header="Busca Cadastro"  widgetVar="userDialog" modal="true" height="400" width="600"  resizable="false" draggable="false" >
        <h:form>
            
            <h:panelGrid id="grid" columns="3" style="margin-bottom:10px">  
                <h:outputLabel for="template" value="Nome:" style="font-weight:bold" styleClass="rotulos"/>  
                <p:inputText id="template" value="#{userBean.nome}" size="25" style="font-family: verdana;
                font-size: 12px;
                font-weight: bold;
                color:#4F4F4F;"/>  
                <p:commandButton id="btn"  actionListener="#{userBean.procuraUsuarios}" value="Buscar" update="dataTable" style="font-family: verdana;
                font-size: 12px;
                font-weight: bold;
                color:#4F4F4F;"/>   
            </h:panelGrid>  
            <p:dataTable id="dataTable" var="car" value="#{userBean.carsSmall}"  widgetVar="carsTable"   
                         emptyMessage="Nenhum usuário encontrado"  >  
                
                <p:column headerText="Usuários" styleClass="rotulos">  
                    <h:outputText value="#{car.nome}" />  
                </p:column>  
                
                 <p:column headerText="Excluir" styleClass="rotulos">  
                   
                     <p:commandButton  action="#{userBean.excluiUsuario}"  icon="ui-icon-close"  update="dataTable" style="font-family: verdana;
                font-size: 12px;
                font-weight: bold;
                color:#4F4F4F;"  >
                         <f:setPropertyActionListener target="#{userBean.cod}" value="#{car.cod}" />
                    </p:commandButton>
                </p:column>  
                
            </p:dataTable>  
            
        </h:form>
    </p:dialog> 


</html>
